{template header}
<h4 style="padding-left:10px;;">
    <span>搜索</span>
    <i class="icon-search"></i>
</h4>
<form class="form-horizontal" method="post" action="">
    <div class="control-group search-group" style="margin:0px;padding:0px;">
        <label class="control-label">ID：</label>
        <div class="controls">
          <input type="text" placeholder="设置后其他选项忽略" name="name" value="{$search['name']}">
        </div>
    </div>
    <div class="control-group search-group" style="margin:0px;padding:0px;">
        <label class="control-label" >类别：</label>
        <div class="controls" id="custom_data">
            <select class="rootCat category" name="rootCat" data-value="{$search['rootCat']}"></select> 
            <select class="childCat category" name="childCat" data-value="{$search['childCat']}"></select> 
        </div>
    </div>
    <div class="control-group search-group"style="margin:0px;padding:0px;" style="margin:0px;padding:0px;">
        <label class="control-label" >关联：</label>
        <div class="controls">
            <select name="filter1">
                <option value="">请选择</option>
                {loop $filterList1 $k $item}
                <option {if $search['filter1'] == $k} selected="selected" {/if} value="{$k}">$item</option>
                {/loop}
            </select>
        </div>
    </div>
    <div class="control-group search-group" style="margin:0px;padding:0px;">
        <label class="control-label" >筛选：</label>
        <div class="controls">
            <select name="filter2">
                <option value="">请选择</option>
                {loop $filterList2 $k $item}
                <option {if $search['filter2'] == $k} selected="selected" {/if} value="{$k}">$item</option>
                {/loop}
            </select>
        </div>
    </div>

    <div class="control-group search-group" style="margin:0px;margin-top:10px;margin-bottom:10px;padding:0px;">
        <div class="controls">
            <input type="hidden" value="search" name="s">
            <button class="btn" type="submit">提交</button>　
            <button class="btn" type="reset">重置</button>
        </div>
    </div>
</form>
<br>
<div class="bs-docs-example" style="clear:both;">
    <table class="table table-striped table-align">
        <thead>
            <tr>
                <th width="60">识货ID</th>
                <th width="70">图片</th>
                <th width="150">识货名称</th>
                <th width="150">跑步名称</th>
                <th width="60">跑步ID</th>
                <th width="100">价格</th>
                <th width="100">类目</th>
                <th width="60">渠道数</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {loop $shihuoList $k $v}
            <tr id="{$v['goods_id']}">
                <td>{$v['goods_id']}</td>
                <td><img src={$v['pic']} width=50 height=50></td>
                <td>{$v['title']}</td>
                <td>{$v['name']}</td>
                <td>{$v['gearId']}</td>
                <td>{$v['price']}({$v['diff']})</td>
                <td>{$v['root_cat_name']}/{$v['child_cat_name']}</td>
                <td>{$v['supplier_count']}</td>
                <td>
                    {if empty($v['gearId'])}
                    <a class="btn btn-edit" target="_blank" href="?c=admin&a=gearInfo&type=add&shihuoId=$v['goods_id']">导入</a>
                    {else}
                    <a class="btn btn-primary" target="_blank" href="?c=admin&a=gearInfo&gearId=$v['gearId']">修改</a>
                    {/if}    
                </td>
            </tr>
            {/loop}
        </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>
<script src="/static/js/jquery.cxselect.min.js"></script>
<script>
    $('#custom_data').cxSelect({
  selects: ['rootCat', 'childCat'],
  jsonName: 'name',
  jsonValue: 'name',
  jsonSub: 'sub',
  data:  $rootCatJson
});
</script>
{template footer}
